﻿using System;
using System.Windows.Controls;
using GalaSoft.MvvmLight.Messaging;
using GlobalOfficeTools.MessagesDto;
using SilverlightMenu.Library;

//xmlns:designViewModel="clr-namespace:GlobalOfficeTools.ViewModels"
// d:DataContext="{d:DesignInstance Type=designViewModel:MainPageViewModelDesign, IsDesignTimeCreatable=True}" 

namespace GlobalOfficeTools
{
    public partial class MainPage : UserControl
    {
        #region Constructor 
        public MainPage()
        {
            InitializeComponent();

            Messenger.Default.Register<NavigationMessage>(this, action =>
            {
                this.frame1.Navigate(new Uri(action.PageName, UriKind.Relative));
            });

            Messenger.Default.Register<SilverlightMenu.Library.MenuItem>(this, action =>
            {
                this.mnuMenu.MenuItem = action;
                this.mnuMenu.DrawMenu(this.mnuMenu, action);
            });
        }
        #endregion
    }
}
